

package com.hazelcast.internal.util.hashslot.impl;

import com.hazelcast.internal.util.hashslot.SlotAssignmentResult;

/**
 * POJO implementation of the result of a slot assignment invocation.
 */
public class SlotAssignmentResultImpl implements SlotAssignmentResult {
    private long address;
    private boolean isNew;

    @Override
    public long address() {
        return address;
    }

    @Override
    public boolean isNew() {
        return isNew;
    }

    /**
     * Sets if the last assignment invocation resulted in a new assignment or
     * if there was an existing slot for the given parameters.
     */
    public void setNew(boolean isNew) {
        this.isNew = isNew;
    }

    /**
     * Sets the current slot assignment address.
     */
    public void setAddress(long address) {
        this.address = address;
    }
}
